<?php

namespace App\Http\Controllers\admin;

use App\Dao\OlisDao;
use App\Services\Code;

class OliController extends BaseController
{
    public function olis()
    {
        if(getIsHasPage()){
            $params = request()->all();
            return Code::message('',200,OlisDao::pageinate($params));
        }
        return view('admin.olis.olis');
    }


    public function add()
    {
        if(isPost()){
            $params = request()->all();
            OlisDao::add($params);
            return Code::message('',200);
        }
        return view('admin.olis.add');
    }


    public function edit()
    {
        if(isPost()){
            $params = request()->all();
            OlisDao::edit($params);
            return Code::message('',200);
        }
        return view('admin.olis.edit',[
            'info'=>OlisDao::info(request()->all())
        ]);
    }
}
